package com.rz.admin.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.rz.admin.entity.Admin;
import com.rz.admin.entity.vo.DeleteParam;

import java.util.List;
import java.util.Map;

public interface IAdminService extends IService<Admin> {
    Map<String, Object> login(Admin admin);
    Admin getByUsername(String username);

    IPage getPage(Admin admin);

    boolean batchDelete(DeleteParam deleteParam);

    boolean onSave(Admin admin);
    List<Admin> getByUserNameAndOrgId(String username,Integer orgId);
    boolean isRepeat(String username,Integer orgId);

    /**
     * 获取指定类型的系统用户
     * @param type
     * @return
     */
    List<Admin> getAdminByType(Integer type);

    /**
     * 获取指定用户的子孙级用户列表（不包含自身）
     * @param id
     * @return
     */
    void getChildren(Integer id,List<Integer> adminIds);


    /**
     * 获取指定用户的子孙级用户id列表（不包含自身id）
     * @param id
     * @return
     */
    List<Integer> getChildrenIds(Integer id);
    void getChildrenAdmin(Integer id,List<Admin> result);

    boolean updatePwd(Admin admin);
}
